-
Notifications
You must be signed in to change notification settings - Fork 3.2k
feat(openai): support retrieval for code interpreter generated files #9899
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(openai): support retrieval for code interpreter generated files #9899
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes look good
Ran + updated examples
examples/ai-core/src/generate-text/openai-responses-code-interpreter.ts&examples/ai-core/src/generate-text/openai-code-interpreter-tool.ts
Can you please also alter one of the examples/next-openai/app examples and try it with a multi-turn chat?
examples/ai-core/src/generate-text/openai-code-interpreter-tool.ts
Outdated
Show resolved
Hide resolved
packages/openai/src/responses/__snapshots__/openai-responses-language-model.test.ts.snap
Show resolved
Hide resolved
|
why is the annotations subkey needed? this will go into stored data via ui messages and is therefore hard to change. (nevermind realized it is an array) |
So I ran the example Adding an example that allows the user to download the file will mean we have to add an API call to retrieve the file data from the container created in OpenAI backend. I thought that wouldn't be necessary for this change but I can add |
@lgrammel i thought storing it the same way we receive from openai api would be easy to follow - would we need the Do you think just storing it in the |
|
@aayush-kapoor dont mind my comment, didnt realize annotations are an array. |
|
noted! @gr2m lmk if this is good to merge, re my comment ^ |
|
added a ui example that allows to download file under |
Background
OpenAI Code Interpreter tool generates files based on users question/query but our current implementation of
annotationsdidn't supportcontainer_file_citation. Hence files generated were getting lostSee #9175
Summary
Updated spec to include
container_file_citationandfile_pathas specified in the OAI spec hereManual Verification
Ran + updated examples
examples/ai-core/src/generate-text/openai-responses-code-interpreter.ts&examples/ai-core/src/generate-text/openai-code-interpreter-tool.tsChecklist
pnpm changesetin the project root)Future Work
Related Issues
Fixes #9175